{% extends "::base.html.twig" %}

{% block title %}
	Accueil - {{ parent() }}
{% endblock %}

{% block stylesheets %}
    <link type="text/css" rel="stylesheet" href="{{asset('css/lightbox-form.css')}}"/>
{% endblock %}

{% block javascripts %}
    <script src="{{asset('js/lightbox-form.js')}}" type="text/javascript"></script>
{% endblock %}

{% block body %}

    <h1>User list</h1>

    <table class="records_list">
        <thead>
            <tr>
                <th>Id</th>
                <th>First_name</th>
                <th>Last_name</th>
                <th>Family_name</th>
                <th>Date_of_birth</th>
                <th>Nationality</th>
                <th>Email</th>
                <th>Login</th>
                <th>Password</th>
                <th>Security_question</th>
                <th>Security_answer</th>
                <th>Date_account_time</th>
                <th>Datecreated</th>
                <th>Dateupdated</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td><a href="{{ path('user_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
                <td>{{ entity.firstname }}</td>
                <td>{{ entity.lastname }}</td>
                <td>{{ entity.familyname }}</td>
                <td>{% if entity.dateofbirth %}{{ entity.dateofbirth|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>{{ entity.nationality }}</td>
                <td>{{ entity.email }}</td>
                <td>{{ entity.login }}</td>
                <td>{{ entity.password }}</td>
                <td>{{ entity.securityquestion }}</td>
                <td>{{ entity.securityanswer }}</td>
                <td>{% if entity.dateaccounttime %}{{ entity.dateaccounttime|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>{% if entity.dateCreated %}{{ entity.dateCreated|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>{% if entity.dateUpdated %}{{ entity.dateUpdated|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>
                    <ul>
                        <li>
                            <a href="{{ path('user_show', { 'id': entity.id }) }}">show</a>
                        </li>
                        <li>
                            <a href="{{ path('user_edit', { 'id': entity.id }) }}">edit</a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <ul>
        <li>
            <a href="{{ path('user_new') }}">
                Create a new entry
            </a>
        </li>
        <li>
            <a href="#" onclick="openbox('Create your account', 0)">formulaire sans fondu</a>
        </li>
    </ul>


    <div id="shadowing"></div>
    <div id="box" class="cms_forms">
        <span id="boxtitle"></span>
        <form class="well" action="{{ path('user_create') }}" method="post" {{ form_enctype(form) }}>
            {{ form_widget(form) }}
            <p>
                <input type="submit"/>
                <input type="button" name="cancel" value="Annuler" onclick="closebox()"/>
            </p>
        </form>
    </div>

{% endblock %}

